uploadWindow = Ext.extend(Ext.Window, {
	panel:null,
	targetFolder:null,
	constructor : function(conf) {
		this.targetFolder=conf.targetFolder;
		Ext.QuickTips.init();
		this.panel=new Ext.form.FormPanel({
			title : '上传文件',
			labelAlign : 'left',
			buttonAlign : 'left',
			id:'uploadPanel',
			labelWidth : 80,
		//	enctype: 'multipart/form-data',
			defaults : {
				autoWidth : true
			},
			padding : 10,
			frame : false,
			border : false,
			autoScroll : true,
			fileUpload : true,
			items:[{
				xtype : 'textfield',
				id : 'txtFile',
				name:'upFile',
				inputType : 'file',
				allowBlank : false,//上传不能为空
				width : 258
			},
			{
				xtype : 'textfield',
				fieldLabel : '默认数据',
				emptyText : this.targetFolder,
				width : 258
			}],
			buttons : [ {
				text : '上传',
				iconCls : 'icon_uploading',
				handler : function() {
					//获取表单
					var thisPanel=Ext.getCmp("uploadPanel");
					if (!thisPanel.getForm().isValid()) {
						Ext.MessageBox.alert("信息", "表单输入验证失败，请正确填写完整！");
						return;
					};
					thisPanel.getForm().submit({ 
						url : 'upload',
						waitMsg: '文件上传中，请稍后……',
						params:{
							fileCode:str_sha1(Ext.getCmp('upWin').targetFolder),
							savePath:Ext.getCmp('upWin').targetFolder,
						},
						method : "POST",
				        success: function(form, response){
				        	alert(hex_sha1(Ext.getCmp('upWin').targetFolder));
				        	var usedspace=response.result.usedspace;
				        	$("#use_space").html((usedspace/1024/1024).toFixed(2)+"M")
				        	$(".spaceUI_span").width(155*(usedspace/1024/1024).toFixed(2)/(totalsize));
				            Ext.Msg.alert('信息', response.result.msg); 
				            Ext.getCmp("gridPanel").getStore()
							.reload();
				            thisPanel.getForm().reset();
				         }, 
				        failure: function(form, response){ 
				           Ext.Msg.alert('错误', response.result.msg); 
				           thisPanel.getForm().reset();
				        } 
				      });
					//submit end
				}
			//handler end
			} ]
			//bbar end
		});
		uploadWindow.superclass.constructor.call(this, {
			height:300,
			width:500,
			id:'upWin',
			items:this.panel
			});
	}
});